<!DOCTYPE html>
<html>
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>

  <body>
    <div id="app"></div>
    <template id="pengfan">
      <!-- 1.lazy修饰符 -->
      <!-- <input type="text" v-model.lazy="message" />
      <h2>{{message}}</h2> -->

      <!-- 2.number修饰符 -->
      <!-- <input type="text" v-model.number="message" />
      <button @click="showType">查看结果</button> -->

      <!-- 3.trim修饰符 -->
      <input type="text" v-model.trim="message">
      <button @click="showResult">查看结果</button>
    </template>
    <script src="../js/vue.js"></script>
    <script>
      Vue.createApp({
        template: "#pengfan",
        data() {
          return {
            message: "Hello World",
          };
        },
        methods: {
          showType() {
              console.log(typeof this.message)
          },
          showResult() {
            console.log(this.message);
          },
        },
      }).mount("#app");
    </script>
  </body>
</html>
